Ext.ns('AIR2.Project');
/***************
 * Project page
 *
 * NOTE: can only be called from within an Ext.onReady()
 */
AIR2.Project = function() {
    var annots = new AIR2.UI.AnnotationPanel({
        valueField: 'prjan_value',
        creField: 'prjan_cre_dtim',
        updField: 'prjan_upd_dtim',
        winTitle: 'Project Annotations',
        storeData: AIR2.Project.ANNOTDATA,
        url: AIR2.Project.BASEURL + '/annotations',
        allowEdit: AIR2.Project.SUMMDATA.authz.may_write
    });
    var tags = new AIR2.UI.TagPanel({
        colspan: 1,
        title: 'Tags',
        iconCls: 'air2-project-tag-icon',
        storeData: AIR2.Project.TAGDATA,
        url: AIR2.Project.BASEURL + '/tags',
        tagMasterUrl: AIR2.HOMEURL + '/tag',
        allowEdit: AIR2.Project.SUMMDATA.authz.may_write
    });

    /* create the application */
    var app = new AIR2.UI.App({
        items: new AIR2.UI.PanelGrid({
            items: [
                AIR2.Project.Submissions(),
                AIR2.Project.Summary(),
                AIR2.Project.Inquiries(),
                annots,
                AIR2.Project.Organizations(),
                AIR2.Project.Statistics(),
                AIR2.Project.Outcomes(),
                AIR2.Project.Activity(),
                tags
            ]
        })
    });
    app.hideProject();
    app.showLocation('Project: '+AIR2.Project.SUMMDATA.radix.prj_display_name,
        'air2-project-location-icon', AIR2.Project.BASEURL);
}
